﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using IrisGenerator.Common.Core;
using IrisGenerator.Common.DataTypes;

namespace IrisGenerator.Common.UI.UserControls
{
    public partial class MetaTypeEquivalencesGridView : UserControl
    {
        public MetaTypeEquivalencesGridView()
        {
            InitializeComponent();
            
        }

        private void LoadEquivalences(Guid? targetId)
        {
            Target.UpdateEquivalences(targetId);

            MetatypeEquivalencesCollection col = 
                MetatypeEquivalences.Select_METATYPE_EQUIVALENCES_By_TAR_ID(targetId);

            this.metatypeEquivalenceDataGrid1.DataSource = col;
        }

        private void targetDropDown1_SelectedIndexChanged_1(object sender, EventArgs e)
        {
            if (targetDropDown1.SelectedValue != null)
            {
                this.metatypeEquivalenceDataGrid1.CurrentTarget =targetDropDown1.SelectedItem as Target;
            }
        }
    }
}
